[#include "/WEB-INF/pages/common/taglibs.ftl"]
[#--通过宏,递归树--]
<ul>
	[#if tree ??]
		[@buildNode child=tree.getChilds() parent=tree /]
	[/#if]
</ul>
[#macro buildNode child parent]
	<li id="${parent.id}" pid="${parent.pid}" item-expanded='true'>
		<a href="javascript:void(0)"  ckey="${parent.id}" pkey="${parent.pid}" item-folder="${parent.getChilds()??}">
			<img style='float: left; margin-right: 5px;' class="[#if parent.getChilds()??]icon-folder-open[#else]icon-file[/#if]" />
		 	<span item-title="true">${parent.name}</span>
		</a>
    [#if child?? && child?size gt 0]
		<ul>
		[#list child as t]
			[#if t.getChilds()?? && t.getChilds()?size gt 0]
				[@buildNode child=t.getChilds() parent=t/]
			[#else]
				[#--不存在儿子节点,则不需要递归,只生成父亲节点数据--]
				<li id="${t.id}" pid="${t.pid}">
					<a href="javascript:void(0)" ckey="${t.id}" pkey="${t.pid}" item-folder="${t.getChilds()??}"> <img style='float: left; margin-right: 5px;' class="[#if t.getChilds()??]icon-folder-open[#else]icon-file[/#if]" />
						<span item-title="true">${t.name}</span>
					</a>
				</li>
			[/#if] 
		[/#list]
		</ul>
    [/#if]
    </li>
[/#macro]

